Reputation: 2337
while trying to generate a proxy from this WebService (http://scdemo14.infor.com:9014/axis/services/wb:wsclocks-inbound?wsdl) I'm receiving this error from svcutil:
Error: Cannot obtain Metadata from http://scdemo14.infor.com:9014/axis/services/wb:wsclocks-inbound?wsdl
If this is a Windows (R) Communication Foundation service to which you have access, please check that you have enabled metadata publishing at the specified address. For help enabling metadata publishing, please refer to the MSDN documentation at http://go.microsoft.com/fwlink/?LinkId=65455.
WS-Metadata Exchange Error URI: http://scdemo14.infor.com:9014/axis/services/wb:wsclocks-inbound?wsdl
Metadata contains a reference that cannot be resolved:
'http://scdemo14.infor.com:9014/axis/services/wb:wsclocks-inbound?wsdl'.
The content type text/xml; charset=utf-8 of the response message
does not match the content type of the binding (application/soap+xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 553 bytes of the response were: '
ns1:Client.NoSOAPAction no SOAPAction header! usalwsc01 '.The remote server returned an error: (500) Internal Server Error.
HTTP GET Error URI: http://scdemo14.infor.com:9014/axis/services/wb:wsclocks-inbound?wsdl
The document at the url http://scdemo14.infor.com:9014/axis/services/wb:wsclocks-inbound?wsdl
was not recognized as a known document type. The error message from each known type may help you fix the problem: - Report from 'XML Schema' is 'The root element of a W3C XML Schema should be and its namespace should be 'http://www.w3.org/2001/XMLSchema'.'. - Report from 'DISCO Document' is 'Discovery document at the URL http://scdemo14.infor.com:9014/axis/services/wb:wsclocks-inbound?wsdl could not be found.'. - The document format is not recognized. - Report from 'WSDL Document' is 'There is an error in XML document (242, 18).'.
- Namespace prefix 'impl:wb' is not defined.
I invoked svcutil with these parameters:
svcutil /n: *,WB.Client /et:WB.Client.WSResultObject /o:Client\WBServices /noConfig http://scdemo14.infor.com:9014/axis/services/wb:wsclocks-inbound?wsdl
Does anyone have an idea what can I do to generate a proxy? I cannot change the service on the server side.
Upvotes: 1
Views: 3779
Reputation: 12135
The problem is that the service uses a naming convention for the binding which is incompatible with svcutil. You can get round this as follows:
Remove the namespace prefix from the name used for the wsdl:binding i.e. change
name="wb:wsclocks-inboundSoapBinding"
to be
name="wsclocks-inboundSoapBinding"
Change the binding attribute of the wsdl:port attribute to match, and also remove the namespace prefix from the value of the name attribute, so it is just wsclocks-inbound.
Then run svcutil <wsdl-file-path> /o:Client\WBServices /noConfig
Upvotes: 3