wsimport help for .net web services

Posted on 2011-10-04
Last Modified: 2012-06-27
i have two .net web services that i want my java client to use.  i am using wsimport to create the JAXWS related classes.  the problem is that both web services ended up writing to the same package folder and overwriting each other's files.  i tried to do this:

[ServiceBehavior(InstanceContextMode = InstanceContextMode.Single, Namespace = "")]

to set a custom target namespace



   <service name="MyServiceConfiguration"...>

      <endpoint name="MyServiceEndpoint"


         contract="Namespaces.MyServiceContract" ...>

to set a binding namespace, but the two web services still overwrite each other.  thanks.
Question by:mmingfeilam
    LVL 17

    Accepted Solution

    Use the -p option on wsimport to specify a different package for each service.

    ie. wsimport -p com.mycomp.ws1.client webservice1.wsdl
    wsimport -p com.mycomp.ws2.client webservice2.wsdl

    Author Comment

    c:\temp\wiimport\1>wsimport -keep -p org.silkroadtech.dataloader "http://sfcaqa001/Services/DataLoaders/HeartBeatIntegration.svc?wsdl"
    parsing WSDL...

    A class/interface with the same name "org.silkroadtech.dataloader.BatchJobDetail" is already in use. Use a class customization to resolve this conflict.
      line 1 of

    (Relevant to above error) another "BatchJobDetail" is generated from here.
      line 1 of

    Two declarations cause a collision in the ObjectFactory class.
      line 1 of

    (Related to above error) This is the other declaration.
      line 1 of

    Two declarations cause a collision in the ObjectFactory class.
      line 1 of

    (Related to above error) This is the other declaration.
      line 1 of
    LVL 6

    Assisted Solution

    There is obviously a class name collision in the generated Java code, but from the information provided it is not possible to say much more. For sorting out the problem, please attach the two .NET services WSDL files.

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Join & Write a Comment

    Suggested Solutions

    While working on Silverlight and WCF application, I faced one issue where fault exception occurred at WCF operation contract is not getting propagated to Silverlight client. So after searching net I came to know that it was behavior by default for s…
    Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
    Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
    This video teaches viewers about errors in exception handling.

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now