Do you have a WSDL that goes with the service? You can use WSDL2java
to generate a client proxy for you. That will make things easier for
you.

I'm not sure you can use the DII call interface to invoke this
service. The service is a document/literal service, and the call
interface is designed to work with RPC services. The call interface
automatically generates unqualified accessor elements for the
parameter types (i.e., the username and password elements). But your
service requires that these elements be qualified. I have never
figured out how to get the call.addParameter method to product a
qualified element.

Anne

On Feb 13, 2008 9:28 AM, Reinout van Schouwen <[EMAIL PROTECTED]> wrote:
> Hello all,
>
> I'm new to this list so if my question is anwered elsewhere and I didn't
> find it in the archive, my apologies.
>
> I have to make some simple calls to a webservice hosted on an IIS
> server. A valid "Login" call should look like this, according to the
> spec:
>
> POST /webservices/ExternalRedirectionService.asmx HTTP/1.1
> Host: gww-ob.nl
> Content-Type: text/xml; charset=utf-8
> Content-Length: length
> SOAPAction: "http://[someurl.tld]/WebServices/Login";
>
> <?xml version="1.0" encoding="utf-8"?>
> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";>
>   <soap:Body>
>     <Login xmlns="http://[someurl.tld]/WebServices/";>
>       <username>string</username>
>       <password>string</password>
>     </Login>
>   </soap:Body>
> </soap:Envelope>
>
> I wrote this code after studying the tutorial (the localhost:8888 is for
> tcpmon, which forwards to the actual server on port 80):
>
>    import org.apache.axis.client.Call;
>    import org.apache.axis.client.Service;
>    import javax.xml.namespace.QName;
>
>    public class TestClient {
>       public static void main(String [] args) {
>           try {
>               String endpoint =
>                        
> "http://localhost:8888/webservices/ExternalRedirectionService.asmx";;
>
>              Service  service = new Service();
>              Call     call    = (Call) service.createCall();
>              call.setTargetEndpointAddress( new java.net.URL(endpoint) );
>              call.setSOAPActionURI("http://[myurl.tld]/WebServices/Login";);
>
>              call.addParameter("username", 
> org.apache.axis.Constants.XSD_STRING, javax.xml.rpc.ParameterMode.IN);
>              call.addParameter("password", 
> org.apache.axis.Constants.XSD_STRING, javax.xml.rpc.ParameterMode.IN);
>
>              call.setReturnType(org.apache.axis.Constants.XSD_STRING);
>
>              String ret = (String) call.invoke(new 
> QName("http://[myurl.tld]/WebServices/";, "Login"), new Object[] { 
> "[username]", "[password]" } );
>
>              System.out.println("Got '" + ret + "'");
>          } catch (Exception e) {
>              System.err.println(e.toString());
>          }
>     }
>   }
>
> This yields the following call:
>
> POST /webservices/ExternalRedirectionService.asmx HTTP/1.0
> Content-Type: text/xml; charset=utf-8
> Accept: application/soap+xml, application/dime, multipart/related, text/*
> User-Agent: Axis/1.2alpha
> Host: [someurl.tld]:8888
> Cache-Control: no-cache
> Pragma: no-cache
> SOAPAction: "http://www.[someurl.tld]/WebServices/Login";
> Content-Length: 520
>
> <?xml version="1.0" encoding="UTF-8"?>
> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"; 
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
>  <soapenv:Body>
>   <ns1:Login 
> soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"; 
> xmlns:ns1="http://www.[someurl.tld]/WebServices/";>
>    <username xsi:type="xsd:string">[username]</username>
>    <password xsi:type="xsd:string">[password]</password>
>   </ns1:Login>
>  </soapenv:Body>
> </soapenv:Envelope>
>
> (I know I'm using an old version of Axis, that's a constraint I have to work 
> with.)
>
> The webserver then replies with:
>
> System.Web.Services.Protocols.SoapException: Server was unable to process 
> request. ---> Csla.DataPortalException: DataPortal.Fetch failed ---> 
> Csla.Server.CallMethodException: DataPortal_Fetch method call failed ---> 
> System.Data.SqlClient.SqlException: Procedure 'security_login' expects 
> parameter '@st_username', which was not supplied.
>
> followed by a long stack trace.
>
> My question is, naturally: what am I doing wrong here?
>
> Thanks for any insights.
>
> regards,
>
> --
> Reinout van Schouwen
> http://vanschouwen.info/
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to