+ Start a Discussion
pfarrellpfarrell 

Soap 1.2 in Apex generated from WSDL

I am generating Apex code from a WSDL file.  Salesforce SOA does not support mulitple bindings, portTypes, or services in a wsdl file.  When I have a WSDL file that only includes Soap 1.2 portType, binding, and service, I get the following error while generating Apex code

Error: Internal error, please contact support with error id: [error id]. Error message: Failed to generate Apex code from WSDL

If I generate a WSDL with only Soap 1.1 portType, binding, and service, I get no errors.

Does this mean that Salesfoce SOA does not support Soap 1.2 WSDL files?
SuperfellSuperfell
Correct, we're not supporting SOAP 1.2.
Cool_DevloperCool_Devloper

Hi Simon.....

1 query i have regarding the same thing, when i tried generating APEX code from my WSDL, it says that Document style WSDL is not supported!!

Is it so?? If yes, than how can i change that to RPC style??

SuperfellSuperfell
We support document/literal style WSDLs only. If you think you have a doc/lit wsdl that's not working, please post it.
sfdcFanBoysfdcFanBoy

The .net WSDL provided to me has soap1.2 binding. If I upload this to generate Apex, it is giving me error. So, I commented out the soap12 binding and successfully generated the Apex class, but finally failed to get the ouput

 

"Cannot send message because the service endpoint hosted at the specified address uses a binding that cannot be accessed over HTTP."

 

So, I have to use that soap12 bindings in WSDL, but Salesforce doesn't accept to convert that WSDL2Apex.

 

Please let me know how to get over the soap1.2 issue.

 

Thanks a lot.

 

Here's my wsdl file. (commented out the part, which Salesforce doesn;t accept. Soap12 binding and port)

 

<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions name="CheckOrder" targetNamespace="http//nsh.test.com/OrderDetails/PoC" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http//nsh.test.com/OrderDetails/PoC" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"><wsp:Policy wsu:Id="RelayEndpoint_policy"><wsp:ExactlyOne><wsp:All><msb:BinaryEncoding xmlns:msb="http://schemas.microsoft.com/ws/06/2004/mspolicy/netbinary1"/><sp:TransportBinding xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy"><wsp:Policy><sp:TransportToken><wsp:Policy><msf:SslTransportSecurity xmlns:msf="http://schemas.microsoft.com/ws/2006/05/framing/policy"/></wsp:Policy></sp:TransportToken><sp:AlgorithmSuite><wsp:Policy><sp:Basic256/></wsp:Policy></sp:AlgorithmSuite><sp:Layout><wsp:Policy><sp:Strict/></wsp:Policy></sp:Layout></wsp:Policy></sp:TransportBinding><rel:RelaySocketConnection xmlns:rel="http://schemas.microsoft.com/netservices/2009/05/servicebus/connect"/><rel:ListenerRelayCredential wsp:Optional="true" xmlns:rel="http://schemas.microsoft.com/netservices/2009/05/servicebus/connect"/><rel:SenderRelayCredential xmlns:rel="http://schemas.microsoft.com/netservices/2009/05/servicebus/connect"/></wsp:All></wsp:ExactlyOne></wsp:Policy><wsdl:types><xs:schema elementFormDefault="qualified" targetNamespace="http//nsh.test.com/OrderDetails/PoC" xmlns:xs="http://www.w3.org/2001/XMLSchema"><xs:import namespace="http://schemas.datacontract.org/2004/07/OrderDetailsService"/><xs:element name="GetOrderDetails"><xs:complexType><xs:sequence><xs:element minOccurs="0" name="orderID" type="xs:int"/></xs:sequence></xs:complexType></xs:element><xs:element name="GetOrderDetailsResponse"><xs:complexType><xs:sequence><xs:element minOccurs="0" name="GetOrderDetailsResult" nillable="true" type="q1:Order" xmlns:q1="http://schemas.datacontract.org/2004/07/OrderDetailsService"/></xs:sequence></xs:complexType></xs:element></xs:schema><xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://schemas.microsoft.com/2003/10/Serialization/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://schemas.microsoft.com/2003/10/Serialization/"><xs:element name="anyType" nillable="true" type="xs:anyType"/><xs:element name="anyURI" nillable="true" type="xs:anyURI"/><xs:element name="base64Binary" nillable="true" type="xs:base64Binary"/><xs:element name="boolean" nillable="true" type="xs:boolean"/><xs:element name="byte" nillable="true" type="xs:byte"/><xs:element name="dateTime" nillable="true" type="xs:dateTime"/><xs:element name="decimal" nillable="true" type="xs:decimal"/><xs:element name="double" nillable="true" type="xs:double"/><xs:element name="float" nillable="true" type="xs:float"/><xs:element name="int" nillable="true" type="xs:int"/><xs:element name="long" nillable="true" type="xs:long"/><xs:element name="QName" nillable="true" type="xs:QName"/><xs:element name="short" nillable="true" type="xs:short"/><xs:element name="string" nillable="true" type="xs:string"/><xs:element name="unsignedByte" nillable="true" type="xs:unsignedByte"/><xs:element name="unsignedInt" nillable="true" type="xs:unsignedInt"/><xs:element name="unsignedLong" nillable="true" type="xs:unsignedLong"/><xs:element name="unsignedShort" nillable="true" type="xs:unsignedShort"/><xs:element name="char" nillable="true" type="tns:char"/><xs:simpleType name="char"><xs:restriction base="xs:int"/></xs:simpleType><xs:element name="duration" nillable="true" type="tns:duration"/><xs:simpleType name="duration"><xs:restriction base="xs:duration"><xs:pattern value="\-?P(\d*D)?(T(\d*H)?(\d*M)?(\d*(\.\d*)?S)?)?"/><xs:minInclusive value="-P10675199DT2H48M5.4775808S"/><xs:maxInclusive value="P10675199DT2H48M5.4775807S"/></xs:restriction></xs:simpleType><xs:element name="guid" nillable="true" type="tns:guid"/><xs:simpleType name="guid"><xs:restriction base="xs:string"><xs:pattern value="[\da-fA-F]{8}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{12}"/></xs:restriction></xs:simpleType>

<!--
<xs:attribute name="FactoryType" type="xs:QName"/>
<xs:attribute name="Id" type="xs:ID"/>
<xs:attribute name="Ref" type="xs:IDREF"/>
-->
</xs:schema>

<xs:schema elementFormDefault="qualified" targetNamespace="http://schemas.datacontract.org/2004/07/OrderDetailsService" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://schemas.datacontract.org/2004/07/OrderDetailsService"><xs:complexType name="Order"><xs:sequence><xs:element minOccurs="0" name="BBS_Desc" nillable="true" type="xs:string"/><xs:element minOccurs="0" name="BBS_Num" nillable="true" type="xs:string"/><xs:element minOccurs="0" name="Conf_Date" type="xs:dateTime"/><xs:element minOccurs="0" name="Cust_PO" nillable="true" type="xs:string"/><xs:element minOccurs="0" name="Order_ID" type="xs:int"/><xs:element minOccurs="0" name="Order_Status" nillable="true" type="xs:string"/><xs:element minOccurs="0" name="PO_Date" type="xs:dateTime"/><xs:element minOccurs="0" name="Prod_Type" nillable="true" type="xs:string"/><xs:element minOccurs="0" name="Reqd_Date" type="xs:dateTime"/><xs:element minOccurs="0" name="Struct_Element" nillable="true" type="xs:string"/><xs:element minOccurs="0" name="WBS1" nillable="true" type="xs:string"/><xs:element minOccurs="0" name="WBS2" nillable="true" type="xs:string"/><xs:element minOccurs="0" name="WBS3" nillable="true" type="xs:string"/></xs:sequence></xs:complexType><xs:element name="Order" nillable="true" type="tns:Order"/></xs:schema></wsdl:types><wsdl:message name="ICheckOrder_GetOrderDetails_InputMessage"><wsdl:part name="parameters" element="tns:GetOrderDetails"/></wsdl:message><wsdl:message name="ICheckOrder_GetOrderDetails_OutputMessage"><wsdl:part name="parameters" element="tns:GetOrderDetailsResponse"/></wsdl:message><wsdl:portType name="ICheckOrder"><wsdl:operation name="GetOrderDetails"><wsdl:input wsaw:Action="http//nsh.test.com/OrderDetails/PoC/ICheckOrder/GetOrderDetails" message="tns:ICheckOrder_GetOrderDetails_InputMessage"/><wsdl:output wsaw:Action="http//nsh.test.com/OrderDetails/PoC/ICheckOrder/GetOrderDetailsResponse" message="tns:ICheckOrder_GetOrderDetails_OutputMessage"/></wsdl:operation></wsdl:portType>


<wsdl:binding name="Local" type="tns:ICheckOrder">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"/><wsdl:operation name="GetOrderDetails"><soap:operation soapAction="http//nsh.test.com/OrderDetails/PoC/ICheckOrder/GetOrderDetails" style="document"/><wsdl:input><soap:body use="literal"/></wsdl:input><wsdl:output><soap:body use="literal"/></wsdl:output></wsdl:operation>
</wsdl:binding>


<!--
<wsdl:binding name="RelayEndpoint" type="tns:ICheckOrder"><wsp:PolicyReference URI="#RelayEndpoint_policy"/><soap12:binding transport=""/><wsdl:operation name="GetOrderDetails"><soap12:operation soapAction="http//nsh.test.com/OrderDetails/PoC/ICheckOrder/GetOrderDetails" style="document"/><wsdl:input><soap12:body use="literal"/></wsdl:input><wsdl:output><soap12:body use="literal"/></wsdl:output></wsdl:operation>
</wsdl:binding>
-->


<wsdl:service name="CheckOrder">

<wsdl:port name="Local" binding="tns:Local"><soap:address location="http://nshtest.servicebus.windows.net/CheckOrderNetTcp/"/>
</wsdl:port>

<!--
<wsdl:port name="RelayEndpoint" binding="tns:RelayEndpoint">
<soap12:address location="sb://nshtest.servicebus.windows.net/CheckOrderNetTcp/"/>
</wsdl:port>
-->


</wsdl:service>

</wsdl:definitions>

 

sfdcFanBoysfdcFanBoy

I have fixed the soap12 errors.  But I get a new error on debug:

 

 

System.CalloutException: Web service callout failed: WebService returned a SOAP Fault: MissingToken: Relay security token is required.  faultcode=a:AuthorizationFailedFault faultactor=

 

Any ideas ?

 

We are not sending username, password.  Is Authorization mandatory? If yes, how to go forward?

 

Please let me know

Shikha Jaiswal TamanShikha Jaiswal Taman
hi sfdcFanBoy,
How you fixed soap12 errors ? I'm also getting the error UNABLE TO FIND SOAP 1.1 ADDRESS.

Thanks !