use p6 web service in .net
There are a lot of web services installed on Primavera P6. WSDL: Acti开发者_JAVA技巧vityCodeAssignment.wsdl
Primary Key Field: A multi-part key comprised of the following elements:
ActivityObjectId
ActivityCodeTypeObjectId
Target Namespace: http://xmlns.oracle.com/Primavera/P6/WS/ActivityCodeAssignment/V1
Default Transport URLs:
http://<hostname>:<port number>/p6ws/services/ActivityCodeAssignment?wsdl
https://<hostname>:<port number>/p6ws/services/ActivityCodeAssignment?wsdl
But if I input this on the web brower: http://my-machine:7005/p6ws/services/ActivityCodeAssignment?wsdl
It shows, "No service was found."
If I try to Add Service Reference in Visual Studio, it says.
There was an error downloading 'http://my-machine:7005/p6ws/services/ActivityCodeAssignment?wsdl'.
The request failed with HTTP status 404: Not Found.
Metadata contains a reference that cannot be resolved: 'http://my-machine:7005/p6ws/services/ActivityCodeAssignment?wsdl'.
There was no endpoint listening at http://my-machine:7005/p6ws/services/ActivityCodeAssignment?wsdl that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.
The remote server returned an error: (404) Not Found.
If the service is defined in the current solution, try building the solution and adding the service reference again.
Is P6 using some different web service?
On my machine, running Oracle database, Weblogic server with P6 version 8.1 Web Services, the URL for this is:
http://<hostname>:<port number>/p6ws/services/ActivityCodeAssignmentService?wsdl
Note the word "Service" tacked onto the end.
Not sure which version of P6 you are using.
Firstly, please check the root web service URL is working or not:
[http://hostname:port/p6ws]
If not, you may need to check your P6 Web Services is installed and deployed correctly or not.
This is P6 Web Services Administrator’s Guide for version 7.0:
http://docs.oracle.com/cd/E16281_01/Technical_Documentation/Web_Services/wsadmin.pdf
If you can access the root web services and other endpoint such as ActivityService [http://host:port/p6ws/services/ActivityService?wsdl] rather than ActivityCodeAssignmentService, but you want to use it, you may need to build your own WS Stubs with following steps:
- Create a Class Library project in .NET with the name P6WSStubs
- Change the Root Namespace to Primavera
- Add a reference to Microsoft WSE 3.0.
- Add the following Web Reference Ws.P6.ActivityCodeAssignment - [http://hostname:port/p6ws/services/ActivityCodeAssignmentService?wsdl]
- Build the P6WSStubs.dll
Hope it will help you,
Yogi
精彩评论