function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Rahul BorgaonkarRahul Borgaonkar 

URL for WSDL to external System

Hi,

This is my first intergration project where webservice class developed by me will be used by external system.

I have created a webservice class on sandbox. The functions from this class will be used by external system. I have created a user so that they will have access to sandbox and can easily access webservice class function. WSDL generated is as below
 
<!--
 Web Services API : QuartzWS
-->
<definitions targetNamespace="http://soap.sforce.com/schemas/class/QuartzWS">
    <types>
        <xsd:schema elementFormDefault="qualified" targetNamespace="http://soap.sforce.com/schemas/class/QuartzWS">
            <xsd:element name="AllowFieldTruncationHeader">
                <xsd:complexType>
                    <xsd:sequence>
                        <xsd:element name="allowFieldTruncation" type="xsd:boolean"/>
                    </xsd:sequence>
                </xsd:complexType>
            </xsd:element>
            <xsd:element name="CallOptions">
                <xsd:complexType>
                    <xsd:sequence>
                        <xsd:element name="client" type="xsd:string"/>
                    </xsd:sequence>
                </xsd:complexType>
            </xsd:element>
            <xsd:element name="DebuggingHeader">
                <xsd:complexType>
                    <xsd:sequence>
                        <xsd:element name="categories" minOccurs="0" maxOccurs="unbounded" type="tns:LogInfo"/>
                        <xsd:element name="debugLevel" type="tns:LogType"/>
                    </xsd:sequence>
                </xsd:complexType>
            </xsd:element>
            <xsd:complexType name="LogInfo">
                <xsd:sequence>
                    <xsd:element name="category" type="tns:LogCategory"/>
                    <xsd:element name="level" type="tns:LogCategoryLevel"/>
                </xsd:sequence>
            </xsd:complexType>
            <xsd:simpleType name="LogCategory">
                <xsd:restriction base="xsd:string">
                    <xsd:enumeration value="Db"/>
                    <xsd:enumeration value="Workflow"/>
                    <xsd:enumeration value="Validation"/>
                    <xsd:enumeration value="Callout"/>
                    <xsd:enumeration value="Apex_code"/>
                    <xsd:enumeration value="Apex_profiling"/>
                    <xsd:enumeration value="Visualforce"/>
                    <xsd:enumeration value="System"/>
                    <xsd:enumeration value="Wave"/>
                    <xsd:enumeration value="All"/>
                </xsd:restriction>
            </xsd:simpleType>
            <xsd:simpleType name="LogCategoryLevel">
                <xsd:restriction base="xsd:string">
                    <xsd:enumeration value="None"/>
                    <xsd:enumeration value="Finest"/>
                    <xsd:enumeration value="Finer"/>
                    <xsd:enumeration value="Fine"/>
                    <xsd:enumeration value="Debug"/>
                    <xsd:enumeration value="Info"/>
                    <xsd:enumeration value="Warn"/>
                    <xsd:enumeration value="Error"/>
                </xsd:restriction>
            </xsd:simpleType>
            <xsd:simpleType name="LogType">
                <xsd:restriction base="xsd:string">
                    <xsd:enumeration value="None"/>
                    <xsd:enumeration value="Debugonly"/>
                    <xsd:enumeration value="Db"/>
                    <xsd:enumeration value="Profiling"/>
                    <xsd:enumeration value="Callout"/>
                    <xsd:enumeration value="Detail"/>
                </xsd:restriction>
            </xsd:simpleType>
            <xsd:element name="DebuggingInfo">
                <xsd:complexType>
                    <xsd:sequence>
                        <xsd:element name="debugLog" type="xsd:string"/>
                    </xsd:sequence>
                </xsd:complexType>
            </xsd:element>
            <xsd:element name="SessionHeader">
                <xsd:complexType>
                    <xsd:sequence>
                        <xsd:element name="sessionId" type="xsd:string"/>
                    </xsd:sequence>
                </xsd:complexType>
            </xsd:element>
            <xsd:simpleType name="ID">
                <xsd:restriction base="xsd:string">
                    <xsd:length value="18"/>
                    <xsd:pattern value="[a-zA-Z0-9]{18}"/>
                </xsd:restriction>
            </xsd:simpleType>
            <xsd:complexType name="wsOutputs">
                <xsd:sequence>
                    <xsd:element name="referenceId" minOccurs="0" type="xsd:string" nillable="true"/>
                    <xsd:element name="returnId" minOccurs="0" maxOccurs="unbounded" type="xsd:string" nillable="true"/>
                    <xsd:element name="returnMessage" minOccurs="0" type="xsd:string" nillable="true"/>
                    <xsd:element name="success" minOccurs="0" type="xsd:boolean" nillable="true"/>
                </xsd:sequence>
            </xsd:complexType>
            <xsd:complexType name="address">
                <xsd:complexContent>
                    <xsd:extension base="tns:location">
                        <xsd:sequence>
                            <xsd:element name="city" type="xsd:string"/>
                            <xsd:element name="country" type="xsd:string"/>
                            <xsd:element name="countryCode" type="xsd:string"/>
                            <xsd:element name="geocodeAccuracy" type="xsd:string"/>
                            <xsd:element name="postalCode" type="xsd:string"/>
                            <xsd:element name="state" type="xsd:string"/>
                            <xsd:element name="stateCode" type="xsd:string"/>
                            <xsd:element name="street" type="xsd:string"/>
                        </xsd:sequence>
                    </xsd:extension>
                </xsd:complexContent>
            </xsd:complexType>
            <xsd:complexType name="location">
                <xsd:sequence>
                    <xsd:element name="latitude" type="xsd:double"/>
                    <xsd:element name="longitude" type="xsd:double"/>
                </xsd:sequence>
            </xsd:complexType>
            <xsd:element name="addUpdateContact">
                <xsd:complexType>
                    <xsd:sequence>
                        <xsd:element name="Salutation" type="xsd:string" nillable="true"/>
                        <xsd:element name="Firstname" type="xsd:string" nillable="true"/>
                        <xsd:element name="Lastname" type="xsd:string" nillable="true"/>
                        <xsd:element name="Title" type="xsd:string" nillable="true"/>
                        <xsd:element name="Email" type="xsd:string" nillable="true"/>
                        <xsd:element name="Phone" type="xsd:string" nillable="true"/>
                        <xsd:element name="Email_Opt_Out" type="xsd:boolean" nillable="true"/>
                        <xsd:element name="Salesforce_Account_Id" type="tns:ID" nillable="true"/>
                        <xsd:element name="Quartz_Account_Id" type="xsd:string" nillable="true"/>
                        <xsd:element name="Quartz_Contact_Id" type="xsd:string" nillable="true"/>
                    </xsd:sequence>
                </xsd:complexType>
            </xsd:element>
            <xsd:element name="addUpdateContactResponse">
                <xsd:complexType>
                    <xsd:sequence>
                        <xsd:element name="result" type="tns:wsOutputs" nillable="true"/>
                    </xsd:sequence>
                </xsd:complexType>
            </xsd:element>
            <xsd:element name="HelloWorld">
                <xsd:complexType>
                    <xsd:sequence/>
                </xsd:complexType>
            </xsd:element>
            <xsd:element name="HelloWorldResponse">
                <xsd:complexType>
                    <xsd:sequence>
                        <xsd:element name="result" type="xsd:string" nillable="true"/>
                    </xsd:sequence>
                </xsd:complexType>
            </xsd:element>
        </xsd:schema>
    </types>
    <!-- Message for the header parts -->
    <message name="Header">
        <part name="AllowFieldTruncationHeader" element="tns:AllowFieldTruncationHeader"/>
        <part name="CallOptions" element="tns:CallOptions"/>
        <part name="DebuggingHeader" element="tns:DebuggingHeader"/>
        <part name="DebuggingInfo" element="tns:DebuggingInfo"/>
        <part name="SessionHeader" element="tns:SessionHeader"/>
    </message>
    <!-- Operation Messages -->
    <message name="addUpdateContactRequest">
        <part element="tns:addUpdateContact" name="parameters"/>
    </message>
    <message name="addUpdateContactResponse">
        <part element="tns:addUpdateContactResponse" name="parameters"/>
    </message>
    <message name="HelloWorldRequest">
        <part element="tns:HelloWorld" name="parameters"/>
    </message>
    <message name="HelloWorldResponse">
        <part element="tns:HelloWorldResponse" name="parameters"/>
    </message>
    <portType name="QuartzWSPortType">
        <operation name="addUpdateContact">
            <input message="tns:addUpdateContactRequest"/>
            <output message="tns:addUpdateContactResponse"/>
        </operation>
        <operation name="HelloWorld">
            <input message="tns:HelloWorldRequest"/>
            <output message="tns:HelloWorldResponse"/>
        </operation>
    </portType>
    <binding name="QuartzWSBinding" type="tns:QuartzWSPortType">
        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
        <operation name="addUpdateContact">
            <soap:operation soapAction=""/>
            <input>
                <soap:header use="literal" part="SessionHeader" message="tns:Header"/>
                <soap:header use="literal" part="CallOptions" message="tns:Header"/>
                <soap:header use="literal" part="DebuggingHeader" message="tns:Header"/>
                <soap:header use="literal" part="AllowFieldTruncationHeader" message="tns:Header"/>
                <soap:body use="literal" parts="parameters"/>
            </input>
            <output>
                <soap:header use="literal" part="DebuggingInfo" message="tns:Header"/>
                <soap:body use="literal"/>
            </output>
        </operation>
        <operation name="HelloWorld">
            <soap:operation soapAction=""/>
            <input>
                <soap:header use="literal" part="SessionHeader" message="tns:Header"/>
                <soap:header use="literal" part="CallOptions" message="tns:Header"/>
                <soap:header use="literal" part="DebuggingHeader" message="tns:Header"/>
                <soap:header use="literal" part="AllowFieldTruncationHeader" message="tns:Header"/>
                <soap:body use="literal" parts="parameters"/>
            </input>
            <output>
                <soap:header use="literal" part="DebuggingInfo" message="tns:Header"/>
                <soap:body use="literal"/>
            </output>
        </operation>
    </binding>
    <service name="QuartzWSService">
        <documentation/>
        <port binding="tns:QuartzWSBinding" name="QuartzWS">
            <soap:address location="https://cs8.salesforce.com/services/Soap/class/QuartzWS"/>
        </port>
    </service>
</definitions>

when I tried to access this class using URL https://cs8.salesforce.com/services/Soap/class/QuartzWS at the end of this xml.

<soap:address location="https://cs8.salesforce.com/services/Soap/class/QuartzWS"/>
it is showing message

Problem accessing /services/Soap/class/QuartzWS. Reason:
Only POST allowed


Could you please let me know how to find this URL so that external system will consume WSDL above and then can access function from webservice class using specific user created? It will help a lot.

Also let me know if need further details.

Best Regards,

Rahul
 
LBKLBK
Hi Rahul,

You cannot browse a SOAP URL that allows only HTTP POST.

To consume a web service, you need to build a Callout Proxy class in the consumer system.

All you need to build this Callout is the WSDL file which you are already having with you.

Is this external system another Salesforce ORG or a third party system?
Rahul BorgaonkarRahul Borgaonkar
Hi, This is a third party external system. I have aleady given them below WSDL to consume. Could you please send steps in short so that the class QuartzWS I have written they should be able to use. Do I have to give them Partner WSDL for authentication? Thanks a lot, waiting for reply. Rahul