Method Community

 

Using API with Java

Last post 06-29-2012 3:06 PM by Method_David. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 06-29-2012 10:27 AM

    • steveb
    • Top 75 Contributor
    • Joined on 04-27-2011
    • United States
    • Posts 79

    Using API with Java

    Hi all,

    I am attempting to use the Method API for several potential development projects with an RDE which uses Java for connectivity.  I don't think I have a way to imbed VB or .NET code into these programs that I am aware of.  I have successully called other API's with this program using the embedded Java code functionality.  Java's directions tell me to get the WSDL information from the 'host' site using the WSIMPORT program which I have.  When I issue the command against 'https://www.methodintegration.com/MethodAPI/service.asmx?wsdl ', which is what the instructions say to do, I get the following messages:

    parsing WSDL...

     

    [WARNING] src-resolve: Cannot resolve the name 'soapenc:Array' to a(n) 'type definition' component.

    line 1144 of https://www.methodintegration.com/MethodAPI/service.asmx?wsdl#types?schema2

    [WARNING] src-resolve.4.2: Error resolving component 's:schema'. It was detected that 's:schema' is in namespace 'http://www.w3.org/2001/XMLSchema', but components from this namespace are not referenceable from schema document 'https://www.methodintegration.com/MethodAPI/service.asmx?wsdl#types?schema1'. If this is the incorrect namespace, perhaps the prefix of 's:schema' needs to be changed. If this is the correct namespace, then an appropriate 'import' tag should be added to 'https://www.methodintegration.com/MethodAPI/service.asmx?wsdl#types?schema1'.

    line 960 of https://www.methodintegration.com/MethodAPI/service.asmx?wsdl#types?schema1

    [ERROR] undefined simple or complex type 'soapenc:Array'

    line 1144 of https://www.methodintegration.com/MethodAPI/service.asmx?wsdl

    [ERROR] undefined element declaration 's:schema'

    line 960 of https://www.methodintegration.com/MethodAPI/service.asmx?wsdl

    [ERROR] undefined element declaration 's:schema'

    line 981 of https://www.methodintegration.com/MethodAPI/service.asmx?wsdl

    [ERROR] undefined element declaration 's:schema'

    line 999 of https://www.methodintegration.com/MethodAPI/service.asmx?wsdl

    [ERROR] undefined element declaration 's:schema'

    line 1020 of https://www.methodintegration.com/MethodAPI/service.asmx?wsdl

    I get no output files created (as should happen).  All I get is the messages on the screen, rather than the detail code file(s) that the WSIMPORT program is supposed to create.  Does anybody have any ideas how to fix this problem?

    Thanks,

     

    Steven Blaustein, CPA.CITP
    Owner / Manager
    MNV Software, LLC.
  • 06-29-2012 10:46 AM In reply to

    Re: Using API with Java

     Hi Steveb,

    Java can invoke and use .NET webservices as needed. I suggest you google something like "java to call a microsoft webservice.", for examples of how to do that.

    Dave

  • 06-29-2012 11:35 AM In reply to

    • steveb
    • Top 75 Contributor
    • Joined on 04-27-2011
    • United States
    • Posts 79

    Re: Using API with Java

     Thanks Dave, I'll look there. 

    Steven Blaustein, CPA.CITP
    Owner / Manager
    MNV Software, LLC.
  • 06-29-2012 2:12 PM In reply to

    • steveb
    • Top 75 Contributor
    • Joined on 04-27-2011
    • United States
    • Posts 79

    Re: Using API with Java

    Steven Blaustein, CPA.CITP
    Owner / Manager
    MNV Software, LLC.
  • 06-29-2012 2:22 PM In reply to

    • steveb
    • Top 75 Contributor
    • Joined on 04-27-2011
    • United States
    • Posts 79

    Re: Using API with Java

    Our great friends at Microsoft screwing up again losing my response !!

    As I was saying ... Dave ... I did the Google search like you recommended and all of the answers say to get the WSDL from the website to obtain the definitions, etc. for the interaction.  It did confirm that I was using the correct format to obtain the WSDL information, but the website wasn't cooperating.

    Some research that I did prior to posting on our forum says that if the schema doesn't resolve it is usually that it isn't exposed (public) or otherwise unresolvable on the web service's server.  That was the root of my original post.

    The WSIMPORT routine is supposed to query the web service's WSDL and generate what it calls 'stubs' which then do the 'heavy lifting' with the Java application to communicate with the web service.

    That is where I'm stuck.

     

    Steven Blaustein, CPA.CITP
    Owner / Manager
    MNV Software, LLC.
  • 06-29-2012 3:06 PM In reply to

    Re: Using API with Java

    Answer

     Hi Steveb,

    Following the article available at http://msdn.microsoft.com/en-us/library/d2s8y7bs%28v=vs.80%29.aspx I successfully generated a proxy class in both C# and VB.Net from the following wsdl https://www.methodintegration.com/MethodAPI/Service.asmx?wsdl

    Have you looked into alternate proxy generation methods such as the eclipse IDE, wsdl2java or svcutil.exe?

    An example of wsdl2java is located at http://msdn.microsoft.com/en-us/library/ms953968.aspx

    Dave

Page 1 of 1 (6 items)