Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1165
  • Last Modified:

wsimport help for .net web services

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 = "http://myservice.com/")]

to set a custom target namespace

or

<services>

   <service name="MyServiceConfiguration"...>

      <endpoint name="MyServiceEndpoint"

         bindingNamespace="http://myservice.com/binding"

         contract="Namespaces.MyServiceContract" ...>

to set a binding namespace, but the two web services still overwrite each other.  thanks.
0
mmingfeilam
Asked:
mmingfeilam
2 Solutions
 
sweetfa2Commented:
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
0
 
mmingfeilamAuthor Commented:
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 http://sfcaqa001.silkroadtech.com/Services/DataLoaders/HeartBeatIntegration.svc?xsd=xsd7

(Relevant to above error) another "BatchJobDetail" is generated from here.
  line 1 of http://sfcaqa001.silkroadtech.com/Services/DataLoaders/HeartBeatIntegration.svc?xsd=xsd5

Two declarations cause a collision in the ObjectFactory class.
  line 1 of http://sfcaqa001.silkroadtech.com/Services/DataLoaders/HeartBeatIntegration.svc?xsd=xsd7

(Related to above error) This is the other declaration.
  line 1 of http://sfcaqa001.silkroadtech.com/Services/DataLoaders/HeartBeatIntegration.svc?xsd=xsd5

Two declarations cause a collision in the ObjectFactory class.
  line 1 of http://sfcaqa001.silkroadtech.com/Services/DataLoaders/HeartBeatIntegration.svc?xsd=xsd7

(Related to above error) This is the other declaration.
  line 1 of http://sfcaqa001.silkroadtech.com/Services/DataLoaders/HeartBeatIntegration.svc?xsd=xsd5
0
 
regevhaCommented:
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.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now