MSDN web service WSDL not parsing - web-services

I am trying to create a web services client for Microsoft's MSDN service (MSTP Content Service). When I use my local IDE to generate the classes it is failing to parse the WSDL from Microsoft published at http://services.msdn.microsoft.com/ContentServices/ContentService.asmx?wsdl and so I tried validating it with a "neutral" validator (XMethods WSDL Validator) and the XMethods validator is saying it cannot parse it with no further significant information. I also tried the eXtc validator and got a similar parse failure. How can I get past this error and create a web services client for MSTP?

I needed code stubs in order to communicate with the MS Content Service System. I used Apache CXF which provides tools for generation of Java or Corba stubs. Apache CXF failed because of a misspelled attribute ("messsage" with 3 s instead of 2):
...
<wsoap12:header messsage="this:AppID" part="AppID" user="literal"/>
...
A download of the formal description file (and correction of misspelled attribute name) wasn't successful because there are further files required for stub generation. I download all missing 14 files.
You could download the WSDL description file and execute the Apache CXF stub generation on this file. This script will abort and print the missing file. So, you have to download this file, manually, and to restart the generation which may abort several times because of further missing files. You can find this files in the schemas folder on the web server, e.g.:
http://services.msdn.microsoft.com/ContentServices/schemas/urn_mtpg_com_mtps_2004_1_image_category_atoms.xsd
http://services.msdn.microsoft.com/ContentServices/schemas/urn_msdn_com_public_content_syndication_2006_09_common.xsd
...
Repeatedly download them and put them into a schemas folder near your WSDL description file.

Related

Stub client generation Apache CXF

I am seeing one behavior while accessing one wsdl. I used Apache Axis 1.3 as well as JAX-WS wsimport tool to generate client stubs, it is successfully generating stubs.
But when I am using apache-cxf-2.7.18 and using wsdl2java command, it's not generating stubs, giving me error.
WSDL is on https. I added proxy in wsdl2java bat file as well. wsdl contains a which is also on https.
Error I am getting like:
enter image description here
It seems to that it's not able to include underlying wsdl.
Can anybody give me any pointer what I am doing wrong?
I believe, when I am doing any service publishing, it can not be client implementation specific like it is supported by Axis but not CXF. or I can do that? Is there any restriction that could be applied?
(Solution in comments)
The error log shows a connection error when downloading the WSDL, probably due to a misconfiguration of the proxy in wsdl2java when using a SSL connection through maven
Maven is not is not able to download imports using the proxy configuration, since you have downloaded the wsdl, you can also download all referenced url resources to local files and change <wsdl:import location= to use each local file. Use a relative path ./yourfile or a URL format file://path/to/the/file

Generating a WCF client for MODIS Web Service

I want to create a WCF client for MODIS Web Service available on this website: http://daac.ornl.gov/MODIS/MODIS-menu/modis_webservice.html There is a link to WSDL file, which can I use to generate proxy class. The problem is, that this file is somehow malformed, I cannot create clients with .NET tools like Add Service Reference, wsdl.exe or svcutil.exe. When I try to generate proxy class through website, I get following response:
I've tried to download the WSDL file and create proxy class from local copy, but then I've got this error:
These errors are the same for Add Service Reference and for console output of wsdl.exe and svcutil.exe utils. Is there any other way to create a WCF client to this service or is it impossible in .NET?
EDIT-----
I've managed that the problem occurs, becouse the WSDL is in RPC/Endoded standard and .NET tools cannot handle it properly. I've tried to convert it to Document/literal standard but it's still not working. Can somebody look at my WSDL file and check what I have wrong? It's available under this link: https://wklej.to/67rR7
removing wsdl:documentation blocks inside the element
tags helps to generating codes via svcutil.exe or wsdl.exe.
Baseline for this solution
Hopes this helps.

Problems with web service, Axis2 and Rampart

I'm new with the Web services and I have a problem obtaining the java files from a WSDL.
The devs of the servers gave me this information:
I have to generate the source with a xmlbeans binding using Axis2 and Rampart. The requests must be signed with a trusted certificate (I have one) and add a Timestamp.
That said, I downloaded the lastest versions of Axis2 and Rampart and executed the next command line without getting errors:
wsdl2java -d xmlbeans -uri https://juntadeandalucia.e-factura.net/puef/services/SSPPWebServiceProxyService?wsdl -o .\src\
I don't have a clue about how to configure Rampart (just copied the modules in repository/modules, inside Axis2 directory) and I don't know if it varies the result neither. The case is that, following the Apache web examples, I can't use the java source generated as is.
For example, to use the consultarFactura method I would need to write a source like this, following the Apache web examples:
SSPPWebServiceProxyServiceStub webservice = new
SSPPWebServiceProxyServiceStub(url); ConsultarFacturaDocument doc =
ConsultarFacturaDocument.Factory.newInstance();
doc.setNumeroRegistro(numeroRegistro); return
webservice.consultarFactura(doc); //Return the response
But setNumeroRegistro() its not a method of ConsultarFacturaDocument (witch is an interface), its a method of another interface called ConsultarFactura defined inside the first one.
wsdl2java gave me a wrong or incomplete code?
I have to do something more before generating the code?
Can I use another framework to generate a more clean code? (I tried cxf, but wsdl2java gave me errors, using the xmlbeans binding or not).
Any help would be highly appreciated.
(Sorry for my bad english)

Visual Studio web reference - $metadata vs. ?wsdl

This is a legacy project that I have not touched in a while. Now the web reference is causing me trouble.
I connect to a SOAP service from a Windows Mobile 6 client. When the service host runs locally on my development box, I can point the web reference to it and it will discover the WSDL, i.e. it will attempt to pull the service description by appending ?wsdl to the endpoint URL. I can build the app and connect to the service from the emulator.
I can for some reason not point Visual Studio to the current production environment for discovery. There it appends /$metadata to the URL instead of ?wsdl. The wsdl is there and I can view it in a browser, though. The mobile app is live and has been connecting to the service for years.
The HTML document does not contain Web service discovery information.
There was an error downloading 'https://mysite/myservice.asmx/$metadata'.
The request failed with the error message:
--
<html>
<head>
<title>Request format is unrecognized for
I know that it is not possible to discover a web service on a non-standard port from Visual Studio. Does it not work with SSL, either? How does Visual Studio decide to use either method for discovery?Or do you have any other thoughts?
I still have no clue what's going wrong with your service but I can discover webservices on non standard ports adding the port to the url (and the ?wsdl as well) from within WS
http://10.177.55.13:10321/MyServices/?wsdl
If this doesn't help open the wsdl in your browser. Copy the xml code, paste it into your editor and save it as .wsdl file. In VS use the filename as url for the service.
HTH
Ruediger

WSO2 ESB Identity Server and Web Service Client

I'm refering to the following article
http://wso2.com/library/articles/2010/10/using-xacml-fine-grained-authorization-wso2-platform/
I would like to use the sample echoService from the WSO2 AS over a secured proxy in WSO2 ESB in combination with the Identity Server for fine-grained authorization. All the settings mentioned on this page seem to work, however I am stuck concerning the client part. I use NetBeans and the given client code, but the .jars in the classpath there have older versions then the ones in the current version of WSO2 IS, so I started to exchange them manually. Now I get some exceptions like
Exception in thread "main" java.lang.NoSuchMethodError: org.apache.xml.security.transforms.Transform.init()V
and I am stuck again. I just want to test the echoService in this constellation and send some string over the ESB via IS and receive the response(if I have the appropriate role) from the AS, is there not another client or how could I test it else?
Thank you!
I can suggest you 3 options:
Use SoapUI to test the service which is the easiest way to test a web service.
Generate the stub for the service and have stub as the dependency in your client. You can use the WSDL2Java tool that ship with AS. Loging to AS --> Tools in left pane --> WSDL2Java --> Provide the wsdl URL and generate the stub jar.
Generate correct dependency libs. Go to [IS-Home]/bin folder, and issue that command "ant" to run the build.xml, this will copy all required libs to [IS-HOME]/repository/lib/ folder. Have them in your class path.