0

i'm trying launching a simple Soap call in my application.

The Soap Web Service is located: 'http://www.asd.com?wsdl'

The Soap Web Service expose method : upload() , to the Ws upload() method i can pass a string data: 'arg0'

so my code looks like as shown:

        $wsdl = "http://www.asd.com?wsdl";
        $ws = new SoapClient($wsdl);
        $vem = $ws->__soapCall('upload', array('arg0'=>'sgfsg'));

Seems that WS method receives arg0 = NULL, is this PHP code ok?

the WS wsdl

      <wsdl:definitions name="aWS" targetNamespace="http://validator.aWS.it/">
<wsdl:import location="http://asd.com/aWS?wsdl=aWSDL.wsdl" namespace="http://interfaces.aWS.it/">
    </wsdl:import><wsdl:binding name="aWSSoapBinding" type="ns1:...">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="Upload">
<soap:operation soapAction="" style="document"/>
<wsdl:input name="Upload">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="UploadResponse"><soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="ping">
<soap:operation soapAction="" style="document"/>
<wsdl:input name="ping">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="pingResponse">
<soap:body use="literal"/>
</wsdl:output>
<wsdl:fault name="NonBlockingExecption">
<soap:fault name="NonBlockingExecption" use="literal"/>
</wsdl:fault>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="aWS">
<wsdl:port binding="tns:aWSSoapBinding" name="aWSPort">
<soap:address location="http://asd.com/aWS"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

the wsdl types

    <wsdl:definitions name="aWS" targetNamespace="http://interfaces.aWS.it/">
<wsdl:types>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="http://interfaces.aWS.it/">
<xs:element name="Upload" type="tns:Upload"/>
<xs:element name="UploadResponse" type="tns:UploadResponse"/>
<xs:element name="ping" type="tns:ping"/>
<xs:element name="pingResponse" type="tns:pingResponse"/>
<xs:complexType name="Upload">
<xs:sequence>
<xs:element minOccurs="0" name="arg0" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="UploadResponse">
<xs:sequence/>
</xs:complexType>
<xs:complexType name="ping">
<xs:sequence/>
</xs:complexType>
<xs:complexType name="pingResponse">
<xs:sequence>
<xs:element name="return" type="xs:int"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="NonBlockingExecption">
<xs:sequence/>
</xs:complexType>
<xs:element name="NonBlockingExecption" type="tns:NonBlockingExecption"/>
</xs:schema>
</wsdl:types>
<wsdl:message name="NonBlockingExecption">
<wsdl:part element="ns1:NonBlockingExecption" name="NonBlockingExecption">
</wsdl:part>
</wsdl:message>
<wsdl:message name="Upload">
<wsdl:part element="ns1:Upload" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="pingResponse">
<wsdl:part element="ns1:pingResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="ping">
<wsdl:part element="ns1:ping" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="UploadResponse">
<wsdl:part element="ns1:UploadResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:portType name="aWS">
<wsdl:operation name="Upload">
<wsdl:input message="ns1:Upload" name="Upload">
</wsdl:input>
<wsdl:output message="ns1:UploadResponse" name="UploadResponse">
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="ping">
<wsdl:input message="ns1:ping" name="ping">
</wsdl:input>
<wsdl:output message="ns1:pingResponse" name="pingResponse">
</wsdl:output>
<wsdl:fault message="ns1:NonBlockingExecption" name="NonBlockingExecption">
</wsdl:fault>
</wsdl:operation>
</wsdl:portType>
</wsdl:definitions>

1 Answer 1

1

Try to change the soap method invocation (third instruction) with:

$vem = $ws->upload("sgfsg");

Usually in WSDL mode soap function are called as methods of the Soap Client object instead of using soapCall.

I tried to open http://www.asd.com?wsdl but i can't see any wsdl code.

If the operation upload only needs a string as parameter you can pass it without building an array.

Sign up to request clarification or add additional context in comments.

2 Comments

asd.com is only an example :)), is a local machine. Anyway your suggest still gives a NULL value at WS :(
You can try to watch inside the content of the http/soap request the client makes. In order to do that you can use utilities like tcpmonitor (for windows) or tcpdump for linux. Many other monitor are available. They allow you to see the format of the soap message generated by the client. So you can check wether the soap message contains the parameter for the upload method or not.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.