Hi,
I'm running into some problems when calling webservices through a proxy created by WebServiceProxyFactory.
Spring successfully retrieves the wsdl to generate the proxy, but when I call web methods on the proxy, it fails with 401 (unauthorized) exception.
I have configured the correct credentials on the WebServiceProxyFactory.
Inspection with wireshark confirms that on the GET call to retrieve the wsdl, authentication succeeds.
And that the web method invocation (http POST) fails wit a 401.
When I use VS to generate a proxy (taking the "classic" create web reference approach), I can successfully invoke authenticated web method calls.
I'm probably missing something here. Any thoughts?
Some more details:
I configured the website on our dev server (Win server 2003, IIS 6.0, .net 3.5 sp1) to use NTLM authentication.
The container of the client configures successfully, and when I use wireshark to monitor http traffic and run the client, I can see that it successfully authenticates when it does a GET to retrieve the wsdl. On the first method call by the client (a POST obv), a 401 is returned and the client fails with:
My current configuration on the server:Code:2012-03-05 13:54:15,012 ERROR - Could not invoke method 'MyMethod' on target object [MyNamespace.MyClass] System.Net.WebException: The request failed with HTTP status 401: Unauthorized. at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClie ntMessage message, WebResponse response, Stream responseStream, Boolean asyncCal l) at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodN ame, Object[] parameters) at SoapHttpClientProxy_41aa3e21304d4e689ab2a0d9ba69c419.MyRemoteMethod(Int64 changeNumber)
The client:HTML Code:<object id="MyService" type="WebServiceExporter"> <property name="TargetName" value="myTarget"/> <property name="Namespace" value="http://services.mycompany/2012/01/21"/> <property name="Description" value="My Description"/> <property name="MemberAttributes"> <dictionary> </dictionary> </property> </object>
HTML Code:<object id="credential" type="System.Net.NetworkCredential, System"> <property name="Domain" value="mydomain" /> <property name="UserName" value="myuser" /> <property name="Password" value="mypassword" /> </object> <object id="webServiceProxyFactoryBase" type="WebServiceProxyFactory" abstract="true"> <property name="Credential" ref="credential" /> <property name="ProductTemplate"> <object> <property name="Timeout" value="10000" /> </object> </property> </object> <object id="myWebServiceProxy" type="WebServiceProxyFactory" parent="webServiceProxyFactoryBase"> <property name="ServiceUri" value="${rooturl}/myservice.asmx" /> <property name="ServiceInterface" value="myinterface>" /> </object>
Regards,
~Marijn
Note: I previously posted a more detailed question, but that one never became visible on the forum, probably due to moderation?
Edit: well, it's visible now: http://forum.springframework.net/sho...ces-quot-calls; I've merged that post into this one.


Reply With Quote