Custom Tool Warning error verifying some XML Schemas during export - c#

I have a web service that I want to consume driven by PHP and SOAP. I can add the web service just fine and I get the list of methods when I added(used add service reference when added). But now I get an error:
Warning 1 Custom tool warning: There was an error verifying some XML Schemas generated during export:
Type 'http://www.w3.org/2001/XMLSchema:struct' is not declared. localPATH:Reference.svcmap 1 1 SOAP_Webservice_Test
From what I understand, this is due to a specific type that I have in my PHP Soap API. I have googled but none of the mentioned fixes does it for me.
Any suggestions how to proceed with my debugging?

Closing this because the problem was not in the client, it was in the soap server I tried to refer to.

Related

Universal windows platform - Consuming web service, ASMX (Content type parsing)

I'm getting started with UWP and wish to consume an old, heavily used ASMX web service written in VB.Net 2.0.
I have created a service reference to the web service but whatever function I call I always end up with the error
"An exception of type 'System.PlatformNotSupportedException' occurred in mscorlib.ni.dll but was not handled in user code
Additional information: MessageEncoder content type parsing is not supported."
There's no further help than this, not sure if it's because the return type is XML and it's expecting JSON or something, even if that were the case I see nowhere to change this.
Here is the relevant lines that I am using to pull back a simple response, help would be greatly appreciated.
WSSoapClient proxy = new WSSoapClient();
Guid ProviderGUID = Guid.Parse("[REDACTED]");
string ProviderPassword = "[REDACTED]";
objWSEthnicitiesGetReturn result;
result = await proxy.WSEthnicitiesGetAsync(ProviderGUID, ProviderPassword);
I found the issue, while the W/S is using HTTP... during use the endpoint was changed to HTTP. Now while there is a redirect in IIS this caused the lookup to always return a 301 error.
In the reference file for the Service Reference I had to alter the proc GetBindingForEndpoint to include the following lines
result.Security.Transport.ClientCredentialType = System.ServiceModel.HttpClientCredentialType.None;
result.Security.Mode = System.ServiceModel.BasicHttpSecurityMode.Transport;
Whilst bringing the reference into the project .NET had also changed all references to the HTTPS to HTTP so I had to do a search for all instances throughout the project and manually change them all.
All is good now though so thank you for your time guys.

Discovery API failing with JSON error

I have a very simple program meant to use the Google Discovery API. However, when I try to use the getRest call, it fails as below. Any ideas? I'm using the most recent version of the Discovery API from NuGet, VS 2012 Pro.
DiscoveryService service = new DiscoveryService(new Google.Apis.Services.BaseClientService.Initializer());
//this works no problem
service.Apis.List().Execute();
//this works on the API reference page's Try It! area, but fails here
service.Apis.GetRest("admin", "directory_v1").Execute();
This is the resulting error that is thrown in the Google.Apis.Requests.ClientServiceRequest class, on the Execute() method - line 96:
JsonSerializationException was unhandled
Additional content found in JSON reference object. A JSON reference object should only have a $ref property. Path 'schemas.User.properties.name.description', line 1251, position 20.
This is a documented error. Get the generated discovery to discovery its own discovery document #79
The only work around I have currently found is to use the Client lib to log in and then manually make my requests from the Discovery API. Its messy and doesn't work very well because you can use the class structure that the Discovery API class library would have given you.

Calling php webservice in visual studio 2010 is giving me error releated to content type

I have created one webservice call in php, it is a RESET webservice.
Now I want to call this webservice in excel 2007. So I am using Visual stdio 2010.
When I give the url in add service refrence dialog box and press go. it's give me this error.
-------error------------------------------------
There was an error downloading 'http://careernet.localhost/rep-details/report_details/retrieves'.
The request failed with HTTP status 404: Not found: Could not find the controller..
Metadata contains a reference that cannot be resolved: 'http://careernet.localhost/rep-details/report_details/retrieves'.
The remote server returned an unexpected response: (406) Not Acceptable: Unsupported request content type application/soap+xml.
The remote server returned an error: (406) Not Acceptable.
If the service is defined in the current solution, try building the solution and adding the service reference again.
I would like to tell that url is correct. my webservice call is returning data in xml format.
I tried to convert this into json but it is not working at all.
Service References don't work against REST webservices, they work against SOAP services or other services that provide a WSDL that describes the protocol in a way that Visual Studio understands.
You'll need to write your own proxy for it using the Web API/HttpClient, or you can make use of existing libraries to communicate:
RestSharp: https://stackoverflow.com/a/4970558/736079

Server returned an invalid soap fault when calling operation from class library

I am using Visual Studio 2012. I have a ASP.NET MVC 4 web app that references a class library. This class library has a service reference. The service reference I added by inserting the URL to the .wsdl file.
I have set up everything correctly. When I do a call to one of the operations then I get an error:
Server returned an invalid SOAP Fault. Please see InnerException for more details.
Then when I view the inner exception:
The data at the root level is invalid. Line 16, position 17.
I am doing everything right, I just don't know why I get this error when I do a call to one of the operations. Where do I see what is returned? I have no control over this service, I am just consuming it.
Run fiddler while making the request. http://fiddler2.com/
This will allow you to see what is actually being sent and what is actually being returned

How to make sense of PHP WSDL

A client (company, not application) has provided a URL to a php-based web service. When I try to work from its url with SOAPUI, WCFTestClient or SvcUtil, all give various levels of non-success.
It looks very much as though there is a case-sensitivity issue. SvcUtil indicates, for example:
Error: There was an error verifying some XML Schemas generated during
export: Type 'http://www.w3.org/2001/XMLSchema:datetime' is not
declared.
Note the case of what I believe should be DateTime.
Is there a way (tool?) that can help generate the C# client side/translate from case-insensitive WSDL?
Note, my web service experience is modest and the customer's is even less so sorry for the basic question. Thanks!

Categories