SOAP xml response received but not populating response object

后端 未结 2 1868
余生分开走
余生分开走 2021-01-17 20:12

I added a "Service Reference" to a vendor\'s Java based web service which i have no control over.

I have this simple client code:

   Client m         


        
2条回答
  •  时光说笑
    2021-01-17 21:00

    I was able to figure out my problem: There was a namespace mismatch.

    The body of my request soap envelope contained:

    
    

    In the response i was getting (top relevant characters only):

    
    

    Notice how the OWS schema namespace in the REQUEST is pointing to http://www.opengis.net/ows

    While the response is pointing to http://www.opengeospatial.net/ows

    Both namespaces have to be the same for .NET to deserialize the data. So you could just have the response respond the correct namespace. In my case, since i had no control over the Java Web Service, i had to modify the auto-generated proxy class and replace all instances of “xmlns:ows=http://www.opengis.net/ows” for “xmlns:ows=http://www.opengeospatial.net/ows”

提交回复
热议问题